package work_space;

public class Drink {
    private final DrinkType drinkType;

    private DrinkStatus status;

    public DrinkType getDrinkType() {
        return drinkType;
    }

    public DrinkStatus getStatus() {
        return status;
    }

    @Override
    public String toString() {
        return "Drink{" +
                "drinkType=" + drinkType +
                ", status=" + status +
                '}';
    }

    public Drink(DrinkType drinkType) {
        this.drinkType = drinkType;
        this.status = DrinkStatus.WAITING;
    }

    public void nextStatus() {
        if (this.status.equals(DrinkStatus.WAITING)) {
            this.status = DrinkStatus.BREWING;
        } else if (this.status.equals(DrinkStatus.BREWING)) {
            this.status = DrinkStatus.FINISHED;
        } else {
            throw new RuntimeException("invalid status");
        }
    }
}
